The code in get_kernel_from_tree_usrlib_modules() that checks for an
"aboot.cfg" does nothing with it (and in fact may leak the fd in case
its there). In practice, /usr/lib/modules never has an aboot.cfg, so
this is just completely dead code.
Signed-off-by: Alexander Larsson <alexl@redhat.com>
The change in https://github.com/ostreedev/ostree/pull/3413/ was meant
to change when the abootcfg option is set in the BLS file. However,
it also changed the value of this key, using the wrong directory
(bootcsumdir instead of /usr/lib/ostree-boot).
This means that during update, aboot-update gets the wrong path to the
config and cannot correctly write the aboot partition.
Signed-off-by: Alexander Larsson <alexl@redhat.com>
Colin Walters [Tue, 22 Jul 2025 14:52:45 +0000 (10:52 -0400)]
rust: Fix a few warnings
- Unused imports because we weren't actually exporting the structs
from those modules
- glib prelude is empty now?
- mount namespace usage is conditional
Colin Walters [Wed, 16 Jul 2025 15:08:00 +0000 (11:08 -0400)]
Add root.transient-ro
An example use case for this is having privileged code
add dynamic new toplevel mountpoints (that don't persist across
reboots/upgrades), while still keeping the rootfs readonly
for processes by default.
Closes: https://github.com/ostreedev/ostree/issues/3471 Signed-off-by: Colin Walters <walters@verbum.org>
Igor Opaniuk [Wed, 11 Sep 2024 16:03:10 +0000 (18:03 +0200)]
sysroot: Support boot counting for boot entries
Add support for boot counting for bootloader entries [1].
The boot counting data is stored in the name of the boot loader entry.
A boot loader entry file name may contain a plus (+) followed by a number.
This may optionally be followed by a minus (-) followed by a second number.
The dot (.) and file name suffix (conf or efi) must immediately follow.
The feature is enabled via sysroot configuration:
[sysroot]
boot-counting-tries=3
$ ls /boot/loader/entries
ostree-1.conf ostree-2+3.conf
[1] https://uapi-group.org/specifications/specs/boot_loader_specification/#boot-counting Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io> Signed-off-by: Colin Walters <walters@verbum.org>
Colin Walters [Wed, 9 Jul 2025 22:04:08 +0000 (18:04 -0400)]
repo: Add new API to write config with reload+validation
The `ostree config set` CLI should really disallow
writing invalid values. To implement that, add a new
API that also *reloads* to the new config, and
rolls back on failure.
Closes: https://github.com/ostreedev/ostree/issues/1827 Signed-off-by: Colin Walters <walters@verbum.org>
Colin Walters [Tue, 8 Jul 2025 22:26:26 +0000 (18:26 -0400)]
docs: Remove <authorgroup>
We've just been copy pasting this; for some commands it's
true, but others have been written by other people. Most of
the commands just call into the library code which is written
by various people.
Colin Walters [Mon, 30 Jun 2025 21:07:18 +0000 (17:07 -0400)]
soft-reboot: Many changes
- Add --reboot and --reset arguments
- Don't compile on centos stream 9 (missing `open_tree` glibc wrapper)
as the functionality isn't supported by systemd there; that said
we should also do dynamic detection
- Fix /sysroot writability
- If we target as soft reboot a deployment
*other* than the staged one, automatically clear the staged
deployment as otherwise the semantics are too confusing.
- Rename the APIs so they all say `soft_reboot` and not `next_root`
Colin Walters [Tue, 1 Jul 2025 18:38:10 +0000 (14:38 -0400)]
deploy: Don't create deployment object before deploying
Just pass the bits of the new deployment we want down into the
checkout function. This lets us reuse the common helper
to init a deployment which now always captures the device/inode.
Colin Walters [Tue, 1 Jul 2025 14:54:52 +0000 (10:54 -0400)]
sysroot: Cache deployment device/inode
This is a lot cleaner. In particular, it's prep
for having soft reboot finalize at shutdown time, because
we weren't correctly handling the staged deployment in
that case.
To implement this we need to basically stop using
ostree_deployment_new() in most places, and instead ensure that all
callers use this path which cache the device/inode.
Colin Walters [Mon, 30 Jun 2025 20:34:11 +0000 (16:34 -0400)]
deploy: Default quiet for forked systemctl
I'm checking over the codebase for places we fork children; doing
so from a library means we may end up printing to stdout/stderr
of our caller, which we shouldn't do.
- Also add an error prefix with information about the service
if we fail
Colin Walters [Wed, 18 Jun 2025 19:10:53 +0000 (15:10 -0400)]
Add ostree admin prepare-soft-reboot
This adds support for systemd soft reboots.
Closes: https://github.com/ostreedev/ostree/issues/3242 Signed-off-by: Colin Walters <walters@verbum.org> Co-authored-by: Joseph Marrero Corchado <jmarrero@redhat.com> Co-authored-by: Mary Strodl <ipadlover8322@gmail.com> Signed-off-by: Colin Walters <walters@verbum.org>
Colin Walters [Thu, 26 Jun 2025 11:48:38 +0000 (07:48 -0400)]
Import jsonwrt code from util-linux
We've had a longstanding need to emit JSON to be friendlier
to shell scripting tools.
I hesitated for (way too long) on which JSON libraries to
use, but actually since we don't need to *parse* JSON,
we only need to omit it, the problem domain is super
simple.
Colin Walters [Tue, 24 Jun 2025 20:08:29 +0000 (16:08 -0400)]
prepare-root: Move metadata for deployment into otcore
- Rename `mount_composefs` to `mount_rootfs` to make a little clearer
what it does; even though if the rootfs is not composefs we don't
do anything before.
- But do always unconditionally update the metadata builder with
the device/inode
Colin Walters [Fri, 30 May 2025 20:14:36 +0000 (16:14 -0400)]
ci: Rework Dockerfile, add Justfile and improved testing
- Move the Dockerfile to the toplevel as a primary dev entrypoint
- The Justfile is intended especially for agentic AI like
block/goose or Claude Code as an allowlistable-command entrypoint
- Include attempt at incremental build caching, partially defeated
by autotools
- Add new tests-unit-container that tests ostree-prepare-root in
a container